import App from './App';
import { createSSRApp } from 'vue'
import store from './store'
import config from './config'
import uView from './uni_modules/vk-uview-ui';

//import filter from './common/utils/filter'
import mixin from './common/mixin/mixin'




import {
    msg,
    close,
    loading,
    hide,
    confirm,
    alert
} from '@/common/utils/dialog.js'
import {
    convertCurrency,
    formatDate,
    prePage,
    checkStr,
    debounce,
    throttle,
    addDate
} from '@/common/utils/util.js'
//挂载
//const app = createApp(App)



// Vue.config.productionTip = false

// App.mpType = 'app'
// const app = new Vue({
//     ...App
// })
// app.$mount()


// #ifdef VUE3

export function createApp() {
  const app = createSSRApp(App)
  app.mixin(mixin)
  app.config.globalProperties.$config = config
  app.config.globalProperties.$store = store
  app.config.globalProperties.$dialog = {
      msg,
      close,
      loading,
      hide,
      confirm,
      alert
  }
  app.config.globalProperties.$util = {
	  convertCurrency,
	  formatDate,
	  prePage,
	  checkStr,
	  debounce,
	  throttle,
	  addDate
  }
  app.use(uView)
  app.use(store)
  
  return {
    app
  }
}
// #endif